

<!DOCTYPE html>


<html lang="zh-CN" >

  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

    <title>WebBot &#8212; Aibote  文档</title>
  
  
  
  <script data-cfasync="false">
    document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
    document.documentElement.dataset.theme = localStorage.getItem("theme") || "light";
  </script>
  
  <!-- Loaded before other Sphinx assets -->
  <link href="../../_static/styles/theme.css?digest=12da95d707ffb74b382d" rel="stylesheet" />
<link href="../../_static/styles/bootstrap.css?digest=12da95d707ffb74b382d" rel="stylesheet" />
<link href="../../_static/styles/pydata-sphinx-theme.css?digest=12da95d707ffb74b382d" rel="stylesheet" />

  
  <link href="../../_static/vendor/fontawesome/6.1.2/css/all.min.css?digest=12da95d707ffb74b382d" rel="stylesheet" />
  <link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2" />

    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/copybutton.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/togglebutton.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/tabs.css" />
  
  <!-- Pre-loaded scripts that we'll load fully later -->
  <link rel="preload" as="script" href="../../_static/scripts/bootstrap.js?digest=12da95d707ffb74b382d" />
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=12da95d707ffb74b382d" />

    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../_static/sphinx_highlight.js"></script>
    <script src="../../_static/clipboard.min.js"></script>
    <script src="../../_static/copybutton.js"></script>
    <script src="../../_static/tabs.js"></script>
    <script>let toggleHintShow = 'Click to show';</script>
    <script>let toggleHintHide = 'Click to hide';</script>
    <script>let toggleOpenOnPrint = 'true';</script>
    <script src="../../_static/togglebutton.js"></script>
    <script src="../../_static/translations.js"></script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script>DOCUMENTATION_OPTIONS.pagename = 'dev_manual/web_bot/index';</script>
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="WindowBot" href="../window_bot/index.html" />
    <link rel="prev" title="AndroidBot" href="../android_bot/index.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="docsearch:language" content="zh-CN"/>
  </head>
  
  
  <body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">

  
  
  <a class="skip-link" href="#main-content">Skip to main content</a>
  
  <input type="checkbox"
          class="sidebar-toggle"
          name="__primary"
          id="__primary"/>
  <label class="overlay overlay-primary" for="__primary"></label>
  
  <input type="checkbox"
          class="sidebar-toggle"
          name="__secondary"
          id="__secondary"/>
  <label class="overlay overlay-secondary" for="__secondary"></label>
  
  <div class="search-button__wrapper">
    <div class="search-button__overlay"></div>
    <div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
      action="../../search.html"
      method="get">
  <i class="fa-solid fa-magnifying-glass"></i>
  <input type="search"
         class="form-control"
         name="q"
         id="search-input"
         placeholder="Search the docs ..."
         aria-label="Search the docs ..."
         autocomplete="off"
         autocorrect="off"
         autocapitalize="off"
         spellcheck="false"/>
  <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
  </div>
  
    <nav class="bd-header navbar navbar-expand-lg bd-navbar">
<div class="bd-header__inner bd-page-width">
  <label class="sidebar-toggle primary-toggle" for="__primary">
    <span class="fa-solid fa-bars"></span>
  </label>
  
  <div class="navbar-header-items__start">
    
      <div class="navbar-item">
  

<a class="navbar-brand logo" href="../../index.html">
  
  
  
  
  
    <p class="title logo__title">Aibote  文档</p>
  
</a></div>
    
  </div>
  
  
  <div class="col-lg-9 navbar-header-items">
    
    <div class="me-auto navbar-header-items__center">
      
        <div class="navbar-item"><nav class="navbar-nav">
  <p class="sidebar-header-items__title"
     role="heading"
     aria-level="1"
     aria-label="Site Navigation">
    Site Navigation
  </p>
  <ul class="bd-navbar-elements navbar-nav">
    
                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../user_guide/index.html">
                        Aibote 基本使用
                      </a>
                    </li>
                

                    <li class="nav-item current active">
                      <a class="nav-link nav-internal" href="../index.html">
                        Aibote 开发手册
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../reference/index.html">
                        API 参考
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../api_protocol/aiboteProtocol.html">
                        API 开源协议
                      </a>
                    </li>
                
  </ul>
</nav></div>
      
    </div>
    
    
    <div class="navbar-header-items__end">
      
        <div class="navbar-item navbar-persistent--container">
          
<script>
document.write(`
  <button class="btn btn-sm navbar-btn search-button search-button__button" title="搜索" aria-label="搜索" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass"></i>
  </button>
`);
</script>
        </div>
      
      
        <div class="navbar-item">
<script>
document.write(`
  <button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
    <span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
    <span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
  </button>
`);
</script></div>
      
    </div>
    
  </div>
  
  
    <div class="navbar-persistent--mobile">
<script>
document.write(`
  <button class="btn btn-sm navbar-btn search-button search-button__button" title="搜索" aria-label="搜索" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass"></i>
  </button>
`);
</script>
    </div>
  

  
    <label class="sidebar-toggle secondary-toggle" for="__secondary">
      <span class="fa-solid fa-outdent"></span>
    </label>
  
</div>

    </nav>
  
  <div class="bd-container">
    <div class="bd-container__inner bd-page-width">
      
      <div class="bd-sidebar-primary bd-sidebar">
        

  
  <div class="sidebar-header-items sidebar-primary__section">
    
    
      <div class="sidebar-header-items__center">
        
          <div class="navbar-item"><nav class="navbar-nav">
  <p class="sidebar-header-items__title"
     role="heading"
     aria-level="1"
     aria-label="Site Navigation">
    Site Navigation
  </p>
  <ul class="bd-navbar-elements navbar-nav">
    
                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../user_guide/index.html">
                        Aibote 基本使用
                      </a>
                    </li>
                

                    <li class="nav-item current active">
                      <a class="nav-link nav-internal" href="../index.html">
                        Aibote 开发手册
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../reference/index.html">
                        API 参考
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../api_protocol/aiboteProtocol.html">
                        API 开源协议
                      </a>
                    </li>
                
  </ul>
</nav></div>
        
      </div>
    
    
    
      <div class="sidebar-header-items__end">
        
          <div class="navbar-item">
<script>
document.write(`
  <button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
    <span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
    <span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
  </button>
`);
</script></div>
        
      </div>
    
  </div>
  
    <div class="sidebar-primary-items__start sidebar-primary__section">
        <div class="sidebar-primary-item"><nav class="bd-docs-nav bd-links"
     aria-label="Section Navigation">
  <p class="bd-links__title" role="heading" aria-level="1">Section Navigation</p>
  <div class="bd-toc-item navbar-nav"><ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../android_bot/index.html">AndroidBot</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">WebBot</a></li>
<li class="toctree-l1"><a class="reference internal" href="../window_bot/index.html">WindowBot</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ui/index.html">界面开发</a></li>
<li class="toctree-l1"><a class="reference internal" href="../web_socket_bot/index.html">WebSocketBot</a></li>
<li class="toctree-l1"><a class="reference internal" href="../multimodule_mixing/index.html">多模块混合开发</a></li>
</ul>
</div>
</nav></div>
    </div>
  
  
  <div class="sidebar-primary-items__end sidebar-primary__section">
  </div>
  
  <div id="rtd-footer-container"></div>


      </div>
      
      <main id="main-content" class="bd-main">
        
        
          <div class="bd-content">
            <div class="bd-article-container">
              
              <div class="bd-header-article">
<div class="header-article-items header-article__inner">
  
    <div class="header-article-items__start">
      
        <div class="header-article-item">



<nav aria-label="Breadcrumbs">
  <ul class="bd-breadcrumbs" role="navigation" aria-label="Breadcrumb">
    
    <li class="breadcrumb-item breadcrumb-home">
      <a href="../../index.html" class="nav-link" aria-label="Home">
        <i class="fa-solid fa-home"></i>
      </a>
    </li>
    
    <li class="breadcrumb-item"><a href="../index.html" class="nav-link">Aibote 开发手册</a></li>
    
    <li class="breadcrumb-item active" aria-current="page">WebBot</li>
  </ul>
</nav>
</div>
      
    </div>
  
  
</div>
</div>
              
              
              
                
<div id="searchbox"></div>
                <article class="bd-article" role="main">
                  
  <section id="webbot">
<h1>WebBot<a class="headerlink" href="#webbot" title="此标题的永久链接">#</a></h1>
<section id="id1">
<h2>主函数示例<a class="headerlink" href="#id1" title="此标题的永久链接">#</a></h2>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-0-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-0-0-0" name="0-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-0-0-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-0-0-1" name="0-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-0-0-0" class="sphinx-tabs-panel" id="panel-0-0-0" name="0-0" role="tabpanel" tabindex="0"><div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">const</span><span class="w"> </span><span class="nx">WebBot</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">require</span><span class="p">(</span><span class="s1">&#39;WebBot&#39;</span><span class="p">);</span><span class="w"> </span><span class="c1">// 引用WebBot模块</span><span class="w"></span>

<span class="c1">//注册主函数</span><span class="w"></span>
<span class="nx">WebBot</span><span class="p">.</span><span class="nx">registerMain</span><span class="p">(</span><span class="nx">webMain</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;127.0.0.1&quot;</span><span class="p">,</span><span class="w"> </span><span class="mf">36678</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="nx">browserName</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;chrome&quot;</span><span class="p">});</span><span class="w"></span>

<span class="cm">/**用作代码提示，webMain函数会被多次调用，注意使用全局变量</span>
<span class="cm"> * @param {WebBot} webBot</span>
<span class="cm"> */</span><span class="w"></span>
<span class="k">async</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="nx">webMain</span><span class="p">(</span><span class="nx">webBot</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">//设置隐式等待</span><span class="w"></span>
<span class="w">    </span><span class="k">await</span><span class="w"> </span><span class="nx">webBot</span><span class="p">.</span><span class="nx">setImplicitTimeout</span><span class="p">(</span><span class="mf">5000</span><span class="p">);</span><span class="w"></span>

<span class="w">    </span><span class="k">await</span><span class="w"> </span><span class="nx">webBot</span><span class="p">.</span><span class="kr">goto</span><span class="p">(</span><span class="s2">&quot;https://www.baidu.com/&quot;</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="k">await</span><span class="w"> </span><span class="nx">webBot</span><span class="p">.</span><span class="nx">sendKeys</span><span class="p">(</span><span class="s1">&#39;//*[@id=&quot;kw&quot;]&#39;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;Aibote\r&quot;</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div><div aria-labelledby="tab-0-0-1" class="sphinx-tabs-panel" hidden="true" id="panel-0-0-1" name="0-1" role="tabpanel" tabindex="0"><div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">time</span>

<span class="c1"># 1. 导入 WebBotMain 类</span>
<span class="kn">from</span> <span class="nn">AiBot</span> <span class="kn">import</span> <span class="n">WebBotMain</span>


<span class="c1"># 2. 自定义一个脚本类，继承 WebBotMain</span>
<span class="k">class</span> <span class="nc">CustomWebScript</span><span class="p">(</span><span class="n">WebBotMain</span><span class="p">):</span>
    <span class="c1"># 3. 设置等待参数</span>
    <span class="c1"># 3.1 设置等待时间</span>
    <span class="n">wait_timeout</span> <span class="o">=</span> <span class="mi">3</span>
    <span class="c1"># 3.2 设置重试间隔时长</span>
    <span class="n">interval_timeout</span> <span class="o">=</span> <span class="mf">0.5</span>

    <span class="c1"># 4. 设置日志等级</span>
    <span class="n">log_level</span> <span class="o">=</span> <span class="s2">&quot;INFO&quot;</span>  <span class="c1"># &quot;DEBUG&quot;</span>

    <span class="c1"># 5. 设置方法超时是否抛出异常</span>
    <span class="n">raise_err</span> <span class="o">=</span> <span class="kc">False</span>  <span class="c1"># True</span>

    <span class="c1"># 6. 重写方法，编写脚本</span>
    <span class="c1"># 注意：此方法是脚本执行入口</span>
    <span class="k">def</span> <span class="nf">script_main</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="c1"># 6. API 演示</span>
        <span class="c1"># 注意：Python 版本支持的 Api 与 Nodejs 基本相同</span>
        <span class="c1"># 教程中仅演示部分 Api，更多 Api 请自行探索，所有 Api 均包含详细的参数要求和返回值，请自行查看。</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">goto</span><span class="p">(</span><span class="s2">&quot;https://www.baidu.com&quot;</span><span class="p">)</span>
        <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">new_page</span><span class="p">(</span><span class="s2">&quot;https://www.qq.com&quot;</span><span class="p">)</span>
        <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>

        <span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">execute_script</span><span class="p">(</span><span class="s1">&#39;(()=&gt;&quot;aibote rpa&quot;)()&#39;</span><span class="p">)</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>  <span class="c1"># aibote rpa</span>


<span class="c1"># 7. 执行脚本，Pycharm 中，直接右键执行</span>
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
    <span class="c1"># 启动脚本，监听 9999 号端口</span>
    <span class="c1"># 默认使用 Chrome 浏览器</span>

    <span class="c1"># local=True 时，是本地运行脚本，会自动启动 WebDriver.exe 驱动；</span>
    <span class="c1"># 在远端部署脚本时，请设置 local=False，手动启动 WebDriver.exe，启动 WebDriver.exe 时需指定远端 IP 或端口号；</span>

    <span class="c1"># 如本地部署脚本，需要传递 WebDriver 启动参数时，参考下面方式，如不需传递启动参数，则忽略：</span>
    <span class="n">driver_params</span> <span class="o">=</span> <span class="p">{</span>
        <span class="s2">&quot;browserName&quot;</span><span class="p">:</span> <span class="s2">&quot;chrome&quot;</span><span class="p">,</span>
        <span class="s2">&quot;debugPort&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
        <span class="s2">&quot;userDataDir&quot;</span><span class="p">:</span> <span class="s2">&quot;./UserData&quot;</span><span class="p">,</span>
        <span class="s2">&quot;browserPath&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
        <span class="s2">&quot;argument&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
    <span class="p">}</span>

    <span class="n">CustomWebScript</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="mi">9999</span><span class="p">,</span> <span class="n">local</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">driver_params</span><span class="o">=</span><span class="n">driver_params</span><span class="p">)</span>
</pre></div>
</div>
</div></div>
</section>
<section id="id2">
<h2>等待超时<a class="headerlink" href="#id2" title="此标题的永久链接">#</a></h2>
<section id="sleep">
<h3>显示等待 <code class="docutils literal notranslate"><span class="pre">sleep()</span></code><a class="headerlink" href="#sleep" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-1-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-1-1-0" name="1-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-1-1-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-1-1-1" name="1-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-1-1-0" class="sphinx-tabs-panel" id="panel-1-1-0" name="1-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.sleep">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">sleep</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">millisecond</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.sleep" title="永久链接至目标">#</a></dt>
<dd><p>睡眠等待</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>millisecond</strong> (<em>number</em>) – 等待时间,单位毫秒</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;void&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-1-1-1" class="sphinx-tabs-panel" hidden="true" id="panel-1-1-1" name="1-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.todo">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#AiBot.WebBotMain.todo" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
<section id="id3">
<h3>隐式等待 <code class="docutils literal notranslate"><span class="pre">sleep()</span></code><a class="headerlink" href="#id3" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-2-2-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-2-2-0" name="2-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-2-2-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-2-2-1" name="2-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-2-2-0" class="sphinx-tabs-panel" id="panel-2-2-0" name="2-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.setImplicitTimeout">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setImplicitTimeout</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">waitMs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intervalMs=100</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.setImplicitTimeout" title="永久链接至目标">#</a></dt>
<dd><p>设置隐式等待</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>waitMs</strong> (<em>number</em>) – 等待时间,单位毫秒</p></li>
<li><p><strong>intervalMs</strong> (<em>number</em>) – 心跳间隔，单位毫秒。可选参数，默认100毫秒</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;void&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-2-2-1" class="sphinx-tabs-panel" hidden="true" id="panel-2-2-1" name="2-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id0">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id0" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
</section>
<section id="id4">
<h2>页面和导航<a class="headerlink" href="#id4" title="此标题的永久链接">#</a></h2>
<section id="url-goto">
<h3>打开URL <code class="docutils literal notranslate"><span class="pre">goto()</span></code><a class="headerlink" href="#url-goto" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-3-3-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-3-3-0" name="3-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-3-3-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-3-3-1" name="3-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-3-3-0" class="sphinx-tabs-panel" id="panel-3-3-0" name="3-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.goto">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">goto</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.goto" title="永久链接至目标">#</a></dt>
<dd><p>跳转url</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>string</em>) – 要跳转的链接，必须http://或https:// 起头</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-3-3-1" class="sphinx-tabs-panel" hidden="true" id="panel-3-3-1" name="3-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.goto">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">goto</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.goto" title="永久链接至目标">#</a></dt>
<dd><p>跳转页面</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> – url 地址</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="newpage">
<h3>新建页面并跳转 <code class="docutils literal notranslate"><span class="pre">newPage()</span></code><a class="headerlink" href="#newpage" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-4-4-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-4-4-0" name="4-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-4-4-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-4-4-1" name="4-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-4-4-0" class="sphinx-tabs-panel" id="panel-4-4-0" name="4-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.newPage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">newPage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.newPage" title="永久链接至目标">#</a></dt>
<dd><p>新建tab页面并跳转到指定url</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>string</em>) – 跳转的链接，必须http://或https:// 起头</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-4-4-1" class="sphinx-tabs-panel" hidden="true" id="panel-4-4-1" name="4-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.new_page">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">new_page</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.new_page" title="永久链接至目标">#</a></dt>
<dd><p>新建 Tab 并跳转页面</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> – url 地址</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="back">
<h3>后退 <code class="docutils literal notranslate"><span class="pre">back()</span></code><a class="headerlink" href="#back" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-5-5-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-5-5-0" name="5-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-5-5-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-5-5-1" name="5-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-5-5-0" class="sphinx-tabs-panel" id="panel-5-5-0" name="5-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.back">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">back</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.back" title="永久链接至目标">#</a></dt>
<dd><p>返回</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-5-5-1" class="sphinx-tabs-panel" hidden="true" id="panel-5-5-1" name="5-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.back">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">back</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.back" title="永久链接至目标">#</a></dt>
<dd><p>后退</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="forward">
<h3>前进 <code class="docutils literal notranslate"><span class="pre">forward()</span></code><a class="headerlink" href="#forward" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-6-6-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-6-6-0" name="6-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-6-6-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-6-6-1" name="6-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-6-6-0" class="sphinx-tabs-panel" id="panel-6-6-0" name="6-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.forward">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">forward</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.forward" title="永久链接至目标">#</a></dt>
<dd><p>前进</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-6-6-1" class="sphinx-tabs-panel" hidden="true" id="panel-6-6-1" name="6-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.forward">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">forward</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.forward" title="永久链接至目标">#</a></dt>
<dd><p>前进</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="refresh">
<h3>刷新 <code class="docutils literal notranslate"><span class="pre">refresh()</span></code><a class="headerlink" href="#refresh" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-7-7-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-7-7-0" name="7-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-7-7-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-7-7-1" name="7-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-7-7-0" class="sphinx-tabs-panel" id="panel-7-7-0" name="7-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.refresh">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">refresh</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.refresh" title="永久链接至目标">#</a></dt>
<dd><p>刷新</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-7-7-1" class="sphinx-tabs-panel" hidden="true" id="panel-7-7-1" name="7-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.refresh">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">refresh</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.refresh" title="永久链接至目标">#</a></dt>
<dd><p>刷新</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="id-getcurpageid">
<h3>获取当前页面ID <code class="docutils literal notranslate"><span class="pre">getCurPageId()</span></code><a class="headerlink" href="#id-getcurpageid" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-8-8-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-8-8-0" name="8-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-8-8-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-8-8-1" name="8-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-8-8-0" class="sphinx-tabs-panel" id="panel-8-8-0" name="8-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getCurPageId">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getCurPageId</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getCurPageId" title="永久链接至目标">#</a></dt>
<dd><p>获取当前页面ID</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回页面ID</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-8-8-1" class="sphinx-tabs-panel" hidden="true" id="panel-8-8-1" name="8-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_current_page_id">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_current_page_id</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_current_page_id" title="永久链接至目标">#</a></dt>
<dd><p>获取当前页面 ID</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="id-getallpageid">
<h3>获取页面ID数组 <code class="docutils literal notranslate"><span class="pre">getAllPageId()</span></code><a class="headerlink" href="#id-getallpageid" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-9-9-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-9-9-0" name="9-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-9-9-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-9-9-1" name="9-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-9-9-0" class="sphinx-tabs-panel" id="panel-9-9-0" name="9-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getAllPageId">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getAllPageId</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getAllPageId" title="永久链接至目标">#</a></dt>
<dd><p>获取所有页面ID</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-9-9-1" class="sphinx-tabs-panel" hidden="true" id="panel-9-9-1" name="9-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_all_page_id">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_all_page_id</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">list</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_all_page_id" title="永久链接至目标">#</a></dt>
<dd><p>获取所有页面 ID</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="switchpage">
<h3>切换指定页面 <code class="docutils literal notranslate"><span class="pre">switchPage()</span></code><a class="headerlink" href="#switchpage" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-10-10-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-10-10-0" name="10-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-10-10-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-10-10-1" name="10-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-10-10-0" class="sphinx-tabs-panel" id="panel-10-10-0" name="10-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.switchPage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">switchPage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pageId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.switchPage" title="永久链接至目标">#</a></dt>
<dd><p>切换指定页面</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>pageId</strong> (<em>string</em>) – 要切换的页面ID</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-10-10-1" class="sphinx-tabs-panel" hidden="true" id="panel-10-10-1" name="10-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.switch_to_page">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">switch_to_page</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">page_id</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.switch_to_page" title="永久链接至目标">#</a></dt>
<dd><p>切换到指定页面</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>page_id</strong> – page id</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="closepage">
<h3>关闭当前页面 <code class="docutils literal notranslate"><span class="pre">closePage()</span></code><a class="headerlink" href="#closepage" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-11-11-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-11-11-0" name="11-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-11-11-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-11-11-1" name="11-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-11-11-0" class="sphinx-tabs-panel" id="panel-11-11-0" name="11-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.closePage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">closePage</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.closePage" title="永久链接至目标">#</a></dt>
<dd><p>关闭当前页面</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-11-11-1" class="sphinx-tabs-panel" hidden="true" id="panel-11-11-1" name="11-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.close_current_page">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">close_current_page</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.close_current_page" title="永久链接至目标">#</a></dt>
<dd><p>关闭当前页面</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="url-getcurrenturl">
<h3>获取URL <code class="docutils literal notranslate"><span class="pre">getCurrentUrl()</span></code><a class="headerlink" href="#url-getcurrenturl" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-12-12-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-12-12-0" name="12-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-12-12-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-12-12-1" name="12-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-12-12-0" class="sphinx-tabs-panel" id="panel-12-12-0" name="12-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getCurrentUrl">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getCurrentUrl</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getCurrentUrl" title="永久链接至目标">#</a></dt>
<dd><p>获取当前页面URL</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;string&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-12-12-1" class="sphinx-tabs-panel" hidden="true" id="panel-12-12-1" name="12-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_current_url">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_current_url</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_current_url" title="永久链接至目标">#</a></dt>
<dd><p>获取当前页面 URL</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p>当前页面 URL 字符串或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="gettitle">
<h3>获取页面标题 <code class="docutils literal notranslate"><span class="pre">getTitle()</span></code><a class="headerlink" href="#gettitle" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-13-13-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-13-13-0" name="13-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-13-13-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-13-13-1" name="13-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-13-13-0" class="sphinx-tabs-panel" id="panel-13-13-0" name="13-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getTitle">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getTitle</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getTitle" title="永久链接至目标">#</a></dt>
<dd><p>获取当前页面标题</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;string&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-13-13-1" class="sphinx-tabs-panel" hidden="true" id="panel-13-13-1" name="13-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_current_title">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_current_title</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_current_title" title="永久链接至目标">#</a></dt>
<dd><p>获取当前页面标题
:return:</p>
</dd></dl>

</div></div>
</section>
</section>
<section id="iframe">
<h2>IFrame<a class="headerlink" href="#iframe" title="此标题的永久链接">#</a></h2>
<section id="frame-switchframe">
<h3>切换frame <code class="docutils literal notranslate"><span class="pre">switchFrame()</span></code><a class="headerlink" href="#frame-switchframe" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-14-14-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-14-14-0" name="14-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-14-14-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-14-14-1" name="14-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-14-14-0" class="sphinx-tabs-panel" id="panel-14-14-0" name="14-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.switchFrame">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">switchFrame</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.switchFrame" title="永久链接至目标">#</a></dt>
<dd><p>切换frame</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 要切换frame的元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-14-14-1" class="sphinx-tabs-panel" hidden="true" id="panel-14-14-1" name="14-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.switch_to_frame">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">switch_to_frame</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.switch_to_frame" title="永久链接至目标">#</a></dt>
<dd><p>切换到指定 frame</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="frame-switchmainframe">
<h3>切换主frame <code class="docutils literal notranslate"><span class="pre">switchMainFrame()</span></code><a class="headerlink" href="#frame-switchmainframe" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-15-15-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-15-15-0" name="15-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-15-15-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-15-15-1" name="15-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-15-15-0" class="sphinx-tabs-panel" id="panel-15-15-0" name="15-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.switchMainFrame">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">switchMainFrame</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.switchMainFrame" title="永久链接至目标">#</a></dt>
<dd><p>切换到主frame</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-15-15-1" class="sphinx-tabs-panel" hidden="true" id="panel-15-15-1" name="15-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.switch_to_main_frame">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">switch_to_main_frame</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.switch_to_main_frame" title="永久链接至目标">#</a></dt>
<dd><p>切回主 frame</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id5">
<h2>元素操作<a class="headerlink" href="#id5" title="此标题的永久链接">#</a></h2>
<section id="click-element">
<h3>点击元素 <code class="docutils literal notranslate"><span class="pre">click_element()</span></code><a class="headerlink" href="#click-element" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-16-16-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-16-16-0" name="16-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-16-16-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-16-16-1" name="16-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-16-16-0" class="sphinx-tabs-panel" id="panel-16-16-0" name="16-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.clickElement">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clickElement</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.clickElement" title="永久链接至目标">#</a></dt>
<dd><p>点击元素</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-16-16-1" class="sphinx-tabs-panel" hidden="true" id="panel-16-16-1" name="16-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.click_element">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">click_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.click_element" title="永久链接至目标">#</a></dt>
<dd><p>点击元素</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="setelementvalue">
<h3>设置编辑框内容 <code class="docutils literal notranslate"><span class="pre">setElementValue()</span></code><a class="headerlink" href="#setelementvalue" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-17-17-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-17-17-0" name="17-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-17-17-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-17-17-1" name="17-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-17-17-0" class="sphinx-tabs-panel" id="panel-17-17-0" name="17-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.setElementValue">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setElementValue</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.setElementValue" title="永久链接至目标">#</a></dt>
<dd><p>设置编辑框值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>value</strong> (<em>string</em>) – 输入的值</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-17-17-1" class="sphinx-tabs-panel" hidden="true" id="panel-17-17-1" name="17-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.set_element_value">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">set_element_value</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.set_element_value" title="永久链接至目标">#</a></dt>
<dd><p>设置元素值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> – 元素 xpath 路径</p></li>
<li><p><strong>value</strong> – 设置的内容</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getelementtext">
<h3>获取元素文本 <code class="docutils literal notranslate"><span class="pre">getElementText()</span></code><a class="headerlink" href="#getelementtext" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-18-18-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-18-18-0" name="18-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-18-18-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-18-18-1" name="18-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-18-18-0" class="sphinx-tabs-panel" id="panel-18-18-0" name="18-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getElementText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementText</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getElementText" title="永久链接至目标">#</a></dt>
<dd><p>获取文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回元素文本，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-18-18-1" class="sphinx-tabs-panel" hidden="true" id="panel-18-18-1" name="18-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_element_text">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_text</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_element_text" title="永久链接至目标">#</a></dt>
<dd><p>获取元素文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>元素文本字符串或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="outerhtml-getelementouterhtml">
<h3>获取outerHTML <code class="docutils literal notranslate"><span class="pre">getElementOuterHTML()</span></code><a class="headerlink" href="#outerhtml-getelementouterhtml" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-19-19-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-19-19-0" name="19-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-19-19-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-19-19-1" name="19-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-19-19-0" class="sphinx-tabs-panel" id="panel-19-19-0" name="19-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getElementOuterHTML">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementOuterHTML</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getElementOuterHTML" title="永久链接至目标">#</a></dt>
<dd><p>获取outerHTML</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回元素outerHTML，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-19-19-1" class="sphinx-tabs-panel" hidden="true" id="panel-19-19-1" name="19-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_element_outer_html">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_outer_html</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_element_outer_html" title="永久链接至目标">#</a></dt>
<dd><p>获取元素的 outerHtml</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="innerhtml-getelementinnerhtml">
<h3>获取innerHTML <code class="docutils literal notranslate"><span class="pre">getElementInnerHTML()</span></code><a class="headerlink" href="#innerhtml-getelementinnerhtml" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-20-20-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-20-20-0" name="20-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-20-20-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-20-20-1" name="20-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-20-20-0" class="sphinx-tabs-panel" id="panel-20-20-0" name="20-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getElementInnerHTML">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementInnerHTML</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getElementInnerHTML" title="永久链接至目标">#</a></dt>
<dd><p>获取innerHTML</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回元素innerHTML，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-20-20-1" class="sphinx-tabs-panel" hidden="true" id="panel-20-20-1" name="20-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_element_inner_html">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_inner_html</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_element_inner_html" title="永久链接至目标">#</a></dt>
<dd><p>获取元素的 innerHtml</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
<p>await webBot.setElementAttribute(xpath, attributeName, value);
//设置属性值
//参数一 字符串型，元素路径
//参数二 字符串型，指定的属性名
//参数三 字符串型，属性值
//成功返回true，失败返回false</p>
</section>
<section id="setelementattribute">
<h3>设置属性值 <code class="docutils literal notranslate"><span class="pre">setElementAttribute()</span></code><a class="headerlink" href="#setelementattribute" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-21-21-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-21-21-0" name="21-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-21-21-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-21-21-1" name="21-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-21-21-0" class="sphinx-tabs-panel" id="panel-21-21-0" name="21-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.setElementAttribute">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setElementAttribute</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.setElementAttribute" title="永久链接至目标">#</a></dt>
<dd><p>设置属性值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>name</strong> (<em>string</em>) – 属性名</p></li>
<li><p><strong>value</strong> (<em>string</em>) – 属性值</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-21-21-1" class="sphinx-tabs-panel" hidden="true" id="panel-21-21-1" name="21-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.set_element_attr">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">set_element_attr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attr_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attr_value</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.set_element_attr" title="永久链接至目标">#</a></dt>
<dd><p>设置元素属性</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> – 元素 xpath 路径</p></li>
<li><p><strong>attr_name</strong> – 属性名称</p></li>
<li><p><strong>attr_value</strong> – 属性值</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getelementattribute">
<h3>获取属性值 <code class="docutils literal notranslate"><span class="pre">getElementAttribute()</span></code><a class="headerlink" href="#getelementattribute" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-22-22-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-22-22-0" name="22-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-22-22-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-22-22-1" name="22-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-22-22-0" class="sphinx-tabs-panel" id="panel-22-22-0" name="22-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getElementAttribute">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementAttribute</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getElementAttribute" title="永久链接至目标">#</a></dt>
<dd><p>获取指定属性的值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>name</strong> (<em>string</em>) – 属性名</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回元素属性值，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-22-22-1" class="sphinx-tabs-panel" hidden="true" id="panel-22-22-1" name="22-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_element_attr">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_attr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attr_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_element_attr" title="永久链接至目标">#</a></dt>
<dd><p>获取元素的属性</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> – xpath 路径</p></li>
<li><p><strong>attr_name</strong> – 属性名称字符串</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="get-element-rect">
<h3>获取矩形位置 <code class="docutils literal notranslate"><span class="pre">get_element_rect()</span></code><a class="headerlink" href="#get-element-rect" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-23-23-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-23-23-0" name="23-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-23-23-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-23-23-1" name="23-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-23-23-0" class="sphinx-tabs-panel" id="panel-23-23-0" name="23-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getElementRect">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementRect</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getElementRect" title="永久链接至目标">#</a></dt>
<dd><p>获取矩形位置</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;{left:number, top:number, right:number, bottom:number, width:number, height:number}&gt;</strong> – 成功返回矩形位置，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-23-23-1" class="sphinx-tabs-panel" hidden="true" id="panel-23-23-1" name="23-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_element_rect">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_rect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">Point</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Point</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_element_rect" title="永久链接至目标">#</a></dt>
<dd><p>获取元素矩形坐标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>元素矩形坐标或None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="isselected">
<h3>判断该元素是否选中 <code class="docutils literal notranslate"><span class="pre">isSelected()</span></code><a class="headerlink" href="#isselected" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-24-24-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-24-24-0" name="24-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-24-24-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-24-24-1" name="24-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-24-24-0" class="sphinx-tabs-panel" id="panel-24-24-0" name="24-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.isSelected">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">isSelected</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.isSelected" title="永久链接至目标">#</a></dt>
<dd><p>判断元素是否选中</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 选中返回true，否则返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-24-24-1" class="sphinx-tabs-panel" hidden="true" id="panel-24-24-1" name="24-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.is_selected">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">is_selected</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.is_selected" title="永久链接至目标">#</a></dt>
<dd><p>元素是否已选中</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="is-displayed">
<h3>判断该元素是否可见 <code class="docutils literal notranslate"><span class="pre">is_displayed()</span></code><a class="headerlink" href="#is-displayed" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-25-25-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-25-25-0" name="25-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-25-25-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-25-25-1" name="25-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-25-25-0" class="sphinx-tabs-panel" id="panel-25-25-0" name="25-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.isDisplayed">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">isDisplayed</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.isDisplayed" title="永久链接至目标">#</a></dt>
<dd><p>判断元素是否可见</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 选中返回true，否则返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-25-25-1" class="sphinx-tabs-panel" hidden="true" id="panel-25-25-1" name="25-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.is_displayed">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">is_displayed</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.is_displayed" title="永久链接至目标">#</a></dt>
<dd><p>元素是否可见</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="isenabled">
<h3>判断元素是否可用 <code class="docutils literal notranslate"><span class="pre">isEnabled()</span></code><a class="headerlink" href="#isenabled" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-26-26-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-26-26-0" name="26-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-26-26-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-26-26-1" name="26-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-26-26-0" class="sphinx-tabs-panel" id="panel-26-26-0" name="26-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.isEnabled">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">isEnabled</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.isEnabled" title="永久链接至目标">#</a></dt>
<dd><p>判断元素是否可用</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 选中返回true，否则返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-26-26-1" class="sphinx-tabs-panel" hidden="true" id="panel-26-26-1" name="26-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.is_available">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">is_available</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.is_available" title="永久链接至目标">#</a></dt>
<dd><p>元素是否可用</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="clearelement">
<h3>清除元素值 <code class="docutils literal notranslate"><span class="pre">clearElement()</span></code><a class="headerlink" href="#clearelement" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-27-27-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-27-27-0" name="27-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-27-27-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-27-27-1" name="27-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-27-27-0" class="sphinx-tabs-panel" id="panel-27-27-0" name="27-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.clearElement">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clearElement</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.clearElement" title="永久链接至目标">#</a></dt>
<dd><p>清空元素值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-27-27-1" class="sphinx-tabs-panel" hidden="true" id="panel-27-27-1" name="27-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.clear_element">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">clear_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.clear_element" title="永久链接至目标">#</a></dt>
<dd><p>清除元素值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="setelementfocus">
<h3>设置元素焦点 <code class="docutils literal notranslate"><span class="pre">setElementFocus()</span></code><a class="headerlink" href="#setelementfocus" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-28-28-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-28-28-0" name="28-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-28-28-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-28-28-1" name="28-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-28-28-0" class="sphinx-tabs-panel" id="panel-28-28-0" name="28-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.setElementFocus">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setElementFocus</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.setElementFocus" title="永久链接至目标">#</a></dt>
<dd><p>设置元素焦点</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-28-28-1" class="sphinx-tabs-panel" hidden="true" id="panel-28-28-1" name="28-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.set_element_focus">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">set_element_focus</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.set_element_focus" title="永久链接至目标">#</a></dt>
<dd><p>设置元素焦点</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="uploadfile">
<h3>通过元素上传文件 <code class="docutils literal notranslate"><span class="pre">uploadFile()</span></code><a class="headerlink" href="#uploadfile" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-29-29-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-29-29-0" name="29-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-29-29-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-29-29-1" name="29-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-29-29-0" class="sphinx-tabs-panel" id="panel-29-29-0" name="29-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.uploadFile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">uploadFile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filePath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.uploadFile" title="永久链接至目标">#</a></dt>
<dd><p>通过元素上传文件</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>filePath</strong> (<em>string</em>) – 本地文件路径，路径不存在会导致网页崩溃</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-29-29-1" class="sphinx-tabs-panel" hidden="true" id="panel-29-29-1" name="29-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.upload_file_by_element">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">upload_file_by_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.upload_file_by_element" title="永久链接至目标">#</a></dt>
<dd><p>通过元素上传文件</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> – 元素 xpath 路径</p></li>
<li><p><strong>file_path</strong> – 文件路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id6">
<h2>鼠标键盘<a class="headerlink" href="#id6" title="此标题的永久链接">#</a></h2>
<section id="sendkeys">
<h3>发送文本 <code class="docutils literal notranslate"><span class="pre">sendKeys()</span></code><a class="headerlink" href="#sendkeys" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-30-30-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-30-30-0" name="30-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-30-30-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-30-30-1" name="30-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-30-30-0" class="sphinx-tabs-panel" id="panel-30-30-0" name="30-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.sendKeys">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">sendKeys</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">text</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.sendKeys" title="永久链接至目标">#</a></dt>
<dd><p>输入文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径，如果元素不能设置焦点，应ClickMouse 点击锁定焦点输入</p></li>
<li><p><strong>text</strong> (<em>string</em>) – 要输入的文本，例如sendKeys(‘//<a href="#id1"><span class="problematic" id="id2">*</span></a>[&#64;id=”kw”]’, ‘aiboter’); aibote换行</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-30-30-1" class="sphinx-tabs-panel" hidden="true" id="panel-30-30-1" name="30-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.send_keys">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">send_keys</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.send_keys" title="永久链接至目标">#</a></dt>
<dd><p>输入值；如果元素不能设置焦点，应先 click_mouse 点击元素获得焦点后再输入</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> – 元素 xpath 路径</p></li>
<li><p><strong>value</strong> – 输入的内容</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="vk-sendvk">
<h3>发送Vk虚拟键 <code class="docutils literal notranslate"><span class="pre">sendVk()</span></code><a class="headerlink" href="#vk-sendvk" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-31-31-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-31-31-0" name="31-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-31-31-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-31-31-1" name="31-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-31-31-0" class="sphinx-tabs-panel" id="panel-31-31-0" name="31-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.sendVk">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">sendVk</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vkCode</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.sendVk" title="永久链接至目标">#</a></dt>
<dd><p>发送Vk虚拟键</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>vkCode</strong> (<em>number</em>) – VK键值，仅支持 回退键:8  制表键:9  回车键:13  空格键:32  方向左键:37  方向上键:38  方向右键:39  方向下键:40  删除键:46</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-31-31-1" class="sphinx-tabs-panel" hidden="true" id="panel-31-31-1" name="31-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.send_vk">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">send_vk</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vk</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.send_vk" title="永久链接至目标">#</a></dt>
<dd><p>输入值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vk</strong> – 输入内容</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="clickmouse">
<h3>点击鼠标 <code class="docutils literal notranslate"><span class="pre">clickMouse()</span></code><a class="headerlink" href="#clickmouse" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-32-32-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-32-32-0" name="32-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-32-32-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-32-32-1" name="32-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-32-32-0" class="sphinx-tabs-panel" id="panel-32-32-0" name="32-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.clickMouse">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clickMouse</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.clickMouse" title="永久链接至目标">#</a></dt>
<dd><p>点击鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>number</em>) – 横坐标，非Windows坐标，页面左上角为起始坐标</p></li>
<li><p><strong>y</strong> (<em>number</em>) – 纵坐标，非Windows坐标，页面左上角为起始坐标</p></li>
<li><p><strong>msg</strong> (<em>number</em>) – 单击左键:1  单击右键:2  按下左键:3  弹起左键:4  按下右键:5  弹起右键:6  双击左键：7</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-32-32-1" class="sphinx-tabs-panel" hidden="true" id="panel-32-32-1" name="32-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.click_mouse">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">click_mouse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">point</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">Point</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">typ</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.click_mouse" title="永久链接至目标">#</a></dt>
<dd><p>点击鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>point</strong> – 坐标点</p></li>
<li><p><strong>typ</strong> – 点击类型，单击左键:1 单击右键:2 按下左键:3 弹起左键:4 按下右键:5 弹起右键:6 双击左键:7</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="movemouse">
<h3>移动鼠标 <code class="docutils literal notranslate"><span class="pre">moveMouse()</span></code><a class="headerlink" href="#movemouse" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-33-33-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-33-33-0" name="33-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-33-33-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-33-33-1" name="33-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-33-33-0" class="sphinx-tabs-panel" id="panel-33-33-0" name="33-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.moveMouse">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">moveMouse</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.moveMouse" title="永久链接至目标">#</a></dt>
<dd><p>移动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>number</em>) – 同clickMouse解释一致</p></li>
<li><p><strong>y</strong> (<em>number</em>) – 同clickMouse解释一致</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-33-33-1" class="sphinx-tabs-panel" hidden="true" id="panel-33-33-1" name="33-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.move_mouse">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">move_mouse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">point</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">Point</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.move_mouse" title="永久链接至目标">#</a></dt>
<dd><p>移动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>point</strong> – 坐标点</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="wheelmouse">
<h3>滚动鼠标 wheelMouse()<a class="headerlink" href="#wheelmouse" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-34-34-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-34-34-0" name="34-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-34-34-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-34-34-1" name="34-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-34-34-0" class="sphinx-tabs-panel" id="panel-34-34-0" name="34-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.wheelMouse">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">wheelMouse</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">deltaX</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">deltaY</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x=0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y=0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.wheelMouse" title="永久链接至目标">#</a></dt>
<dd><p>滚动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>deltaX</strong> (<em>number</em>) – 水平滚动条移动的距离</p></li>
<li><p><strong>deltaY</strong> (<em>number</em>) – 垂直滚动条移动的距离</p></li>
<li><p><strong>x</strong> (<em>number</em>) – 可选参数，鼠标横坐标位置， 默认为0</p></li>
<li><p><strong>y</strong> (<em>number</em>) – 可选参数，鼠标纵坐标位置， 默认为0</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-34-34-1" class="sphinx-tabs-panel" hidden="true" id="panel-34-34-1" name="34-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.scroll_mouse">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">scroll_mouse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">offset_x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset_y</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.scroll_mouse" title="永久链接至目标">#</a></dt>
<dd><p>滚动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>offset_x</strong> – 水平滚动条移动的距离</p></li>
<li><p><strong>offset_y</strong> – 垂直滚动条移动的距离</p></li>
<li><p><strong>x</strong> – 鼠标横坐标位置， 默认为0</p></li>
<li><p><strong>y</strong> – 鼠标纵坐标位置， 默认为0</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="xpath-clickmousebyxpath">
<h3>通过 xpath 点击鼠标(元素中心点) <code class="docutils literal notranslate"><span class="pre">clickMouseByXpath()</span></code><a class="headerlink" href="#xpath-clickmousebyxpath" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-35-35-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-35-35-0" name="35-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-35-35-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-35-35-1" name="35-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-35-35-0" class="sphinx-tabs-panel" id="panel-35-35-0" name="35-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.clickMouseByXpath">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clickMouseByXpath</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.clickMouseByXpath" title="永久链接至目标">#</a></dt>
<dd><p>通过xpath 点击鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>msg</strong> (<em>number</em>) – 单击左键:1  单击右键:2  按下左键:3  弹起左键:4  按下右键:5  弹起右键:6  双击左键：7</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-35-35-1" class="sphinx-tabs-panel" hidden="true" id="panel-35-35-1" name="35-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.click_mouse_by_element">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">click_mouse_by_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">typ</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.click_mouse_by_element" title="永久链接至目标">#</a></dt>
<dd><p>根据元素位置点击鼠标(元素中心点)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> – 元素 xpath 路径</p></li>
<li><p><strong>typ</strong> – 点击类型，单击左键:1 单击右键:2 按下左键:3 弹起左键:4 按下右键:5 弹起右键:6 双击左键:7</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="xpath-movemousebyxpath">
<h3>通过 xpath 移动鼠标(元素中心点) <code class="docutils literal notranslate"><span class="pre">moveMouseByXpath()</span></code><a class="headerlink" href="#xpath-movemousebyxpath" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-36-36-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-36-36-0" name="36-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-36-36-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-36-36-1" name="36-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-36-36-0" class="sphinx-tabs-panel" id="panel-36-36-0" name="36-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.moveMouseByXpath">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">moveMouseByXpath</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.moveMouseByXpath" title="永久链接至目标">#</a></dt>
<dd><p>通过xpath 移动鼠标到元素的中心点</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-36-36-1" class="sphinx-tabs-panel" hidden="true" id="panel-36-36-1" name="36-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.move_to_element">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">move_to_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.move_to_element" title="永久链接至目标">#</a></dt>
<dd><p>移动鼠标到元素位置(元素中心点)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – 元素 xpath 路径</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="xpath-wheelmousebyxpath">
<h3>通过 xpath 滚动鼠标 <code class="docutils literal notranslate"><span class="pre">wheelMouseByXpath()</span></code><a class="headerlink" href="#xpath-wheelmousebyxpath" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-37-37-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-37-37-0" name="37-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-37-37-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-37-37-1" name="37-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-37-37-0" class="sphinx-tabs-panel" id="panel-37-37-0" name="37-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.wheelMouseByXpath">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">wheelMouseByXpath</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">deltaX</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">deltaY</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.wheelMouseByXpath" title="永久链接至目标">#</a></dt>
<dd><p>通过xpath 滚动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>deltaX</strong> (<em>number</em>) – 水平滚动条移动的距离</p></li>
<li><p><strong>deltaY</strong> (<em>number</em>) – 垂直滚动条移动的距离</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-37-37-1" class="sphinx-tabs-panel" hidden="true" id="panel-37-37-1" name="37-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.scroll_mouse_by_element">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">scroll_mouse_by_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset_x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset_y</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.scroll_mouse_by_element" title="永久链接至目标">#</a></dt>
<dd><p>根据元素位置滚动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>offset_x</strong> – 水平滚动条移动的距离</p></li>
<li><p><strong>offset_y</strong> – 垂直滚动条移动的距离</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id7">
<h2>截图<a class="headerlink" href="#id7" title="此标题的永久链接">#</a></h2>
<section id="png-base64-takescreenshot">
<h3>截图(PNG-base64) <code class="docutils literal notranslate"><span class="pre">takeScreenshot()</span></code><a class="headerlink" href="#png-base64-takescreenshot" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-38-38-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-38-38-0" name="38-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-38-38-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-38-38-1" name="38-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-38-38-0" class="sphinx-tabs-panel" id="panel-38-38-0" name="38-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.takeScreenshot">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">takeScreenshot</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath=&quot;null&quot;</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.takeScreenshot" title="永久链接至目标">#</a></dt>
<dd><p>截图</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xpath</strong> (<em>string</em>) – 可选参数，元素路径。如果指定该参数则截取元素图片</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;(string|boolean)&gt;</strong> – 成功返回PNG图片格式 base64 字符串，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-38-38-1" class="sphinx-tabs-panel" hidden="true" id="panel-38-38-1" name="38-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.save_screenshot">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">save_screenshot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.save_screenshot" title="永久链接至目标">#</a></dt>
<dd><p>截图，返回 PNG 格式的 base64</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>xpath</strong> – 元素路径，如果指定该参数则截取元素图片；</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>PNG 格式的 base64 的字符串或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="alert-prompt">
<h2>alert/prompt弹窗<a class="headerlink" href="#alert-prompt" title="此标题的永久链接">#</a></h2>
<section id="clickalert">
<h3>点击警告框 <code class="docutils literal notranslate"><span class="pre">clickAlert()</span></code><a class="headerlink" href="#clickalert" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-39-39-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-39-39-0" name="39-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-39-39-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-39-39-1" name="39-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-39-39-0" class="sphinx-tabs-panel" id="panel-39-39-0" name="39-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.clickAlert">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clickAlert</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">acceptOrCancel</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">promptText</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.clickAlert" title="永久链接至目标">#</a></dt>
<dd><p>点击警告框</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>acceptOrCancel</strong> (<em>boolean</em>) – true接受, false取消</p></li>
<li><p><strong>promptText</strong> (<em>string</em>) – 可选参数，输入prompt警告框文本</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-39-39-1" class="sphinx-tabs-panel" hidden="true" id="panel-39-39-1" name="39-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.click_alert">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">click_alert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">accept</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prompt_text</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.click_alert" title="永久链接至目标">#</a></dt>
<dd><p>点击警告框</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>accept</strong> – 确认或取消</p></li>
<li><p><strong>prompt_text</strong> – 可选参数，输入的警告框文本</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getalerttext">
<h3>获取警告框文本 <code class="docutils literal notranslate"><span class="pre">getAlertText()</span></code><a class="headerlink" href="#getalerttext" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-40-40-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-40-40-0" name="40-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-40-40-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-40-40-1" name="40-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-40-40-0" class="sphinx-tabs-panel" id="panel-40-40-0" name="40-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getAlertText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getAlertText</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getAlertText" title="永久链接至目标">#</a></dt>
<dd><p>获取警告框内容</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;boolean&gt;</strong> – 返回警告框内容</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-40-40-1" class="sphinx-tabs-panel" hidden="true" id="panel-40-40-1" name="40-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_alert_text">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_alert_text</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_alert_text" title="永久链接至目标">#</a></dt>
<dd><p>获取警告框文本</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p>警告框文本字符串</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="cookie">
<h2>cookie操作<a class="headerlink" href="#cookie" title="此标题的永久链接">#</a></h2>
<section id="urlcookies-getcookies-url">
<h3>获取指定url匹配的cookies <code class="docutils literal notranslate"><span class="pre">getCookies(url)</span></code><a class="headerlink" href="#urlcookies-getcookies-url" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-41-41-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-41-41-0" name="41-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-41-41-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-41-41-1" name="41-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-41-41-0" class="sphinx-tabs-panel" id="panel-41-41-0" name="41-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getCookies">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getCookies</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getCookies" title="永久链接至目标">#</a></dt>
<dd><p>获取指定url匹配的cookies</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>string</em>) – 指定的url <a class="reference external" href="http:/">http:/</a>/或https:// 起头</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回json格式的字符串，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-41-41-1" class="sphinx-tabs-panel" hidden="true" id="panel-41-41-1" name="41-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_cookies">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_cookies</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_cookies" title="永久链接至目标">#</a></dt>
<dd><p>获取指定 url 的 Cookies</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> – url 字符串</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="cookies-getallcookies">
<h3>获取所有的Cookies <code class="docutils literal notranslate"><span class="pre">getAllCookies()</span></code><a class="headerlink" href="#cookies-getallcookies" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-42-42-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-42-42-0" name="42-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-42-42-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-42-42-1" name="42-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-42-42-0" class="sphinx-tabs-panel" id="panel-42-42-0" name="42-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getAllCookies">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getAllCookies</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getAllCookies" title="永久链接至目标">#</a></dt>
<dd><p>获取所有cookies</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回json格式的字符串，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-42-42-1" class="sphinx-tabs-panel" hidden="true" id="panel-42-42-1" name="42-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_all_cookies">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_all_cookies</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_all_cookies" title="永久链接至目标">#</a></dt>
<dd><p>获取所有的 Cookies</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p>列表格式的 cookies</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="cookies-setcookie">
<h3>设置cookies <code class="docutils literal notranslate"><span class="pre">setCookie()</span></code><a class="headerlink" href="#cookies-setcookie" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-43-43-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-43-43-0" name="43-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-43-43-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-43-43-1" name="43-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-43-43-0" class="sphinx-tabs-panel" id="panel-43-43-0" name="43-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.setCookie">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setCookie</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cookieParam</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.setCookie" title="永久链接至目标">#</a></dt>
<dd><p>设置cookie</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cookieParam</strong> (<em>Object</em>) – cookie参数， name、value和url必填参数，其他参数可选</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-43-43-1" class="sphinx-tabs-panel" hidden="true" id="panel-43-43-1" name="43-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.set_cookies">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">set_cookies</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.set_cookies" title="永久链接至目标">#</a></dt>
<dd><p>设置指定 url 的 Cookies</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – 要设置 Cookie 的域</p></li>
<li><p><strong>name</strong> – Cookie 名</p></li>
<li><p><strong>value</strong> – Cookie 值</p></li>
<li><p><strong>options</strong> – 其他属性</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="cookies-deletecookies">
<h3>删除cookies <code class="docutils literal notranslate"><span class="pre">deleteCookies()</span></code><a class="headerlink" href="#cookies-deletecookies" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-44-44-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-44-44-0" name="44-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-44-44-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-44-44-1" name="44-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-44-44-0" class="sphinx-tabs-panel" id="panel-44-44-0" name="44-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.deleteCookies">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">deleteCookies</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.deleteCookies" title="永久链接至目标">#</a></dt>
<dd><p>删除指定cookies</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<em>string</em>) – 要删除的 Cookie 的名称。</p></li>
<li><p><strong>options</strong> (<em>Object</em>) – 可选参数 url 如果指定，则删除所有匹配 url 和 name的Cookie domain 如果指定，则删除所有匹配 domain 和 name的Cookie path 如果指定，则删除所有匹配 path 和 name的Cookie</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-44-44-1" class="sphinx-tabs-panel" hidden="true" id="panel-44-44-1" name="44-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.delete_cookies">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">delete_cookies</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.delete_cookies" title="永久链接至目标">#</a></dt>
<dd><p>删除指定 Cookie</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> – 要删除的 Cookie 的名称</p></li>
<li><p><strong>url</strong> – 删除所有匹配 url 和 name 的 Cookie</p></li>
<li><p><strong>domain</strong> – 删除所有匹配 domain 和 name 的 Cookie</p></li>
<li><p><strong>path</strong> – 删除所有匹配 path 和 name 的 Cookie</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="cookies-deleteallcookies">
<h3>删除所有cookies <code class="docutils literal notranslate"><span class="pre">deleteAllCookies()</span></code><a class="headerlink" href="#cookies-deleteallcookies" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-45-45-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-45-45-0" name="45-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-45-45-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-45-45-1" name="45-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-45-45-0" class="sphinx-tabs-panel" id="panel-45-45-0" name="45-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.deleteAllCookies">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">deleteAllCookies</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.deleteAllCookies" title="永久链接至目标">#</a></dt>
<dd><p>删除所有cookies</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-45-45-1" class="sphinx-tabs-panel" hidden="true" id="panel-45-45-1" name="45-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.delete_all_cookies">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">delete_all_cookies</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.delete_all_cookies" title="永久链接至目标">#</a></dt>
<dd><p>删除所有 Cookie</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="clearcache">
<h3>清除缓存 <code class="docutils literal notranslate"><span class="pre">clearCache()</span></code><a class="headerlink" href="#clearcache" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-46-46-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-46-46-0" name="46-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-46-46-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-46-46-1" name="46-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-46-46-0" class="sphinx-tabs-panel" id="panel-46-46-0" name="46-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.clearCache">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clearCache</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.clearCache" title="永久链接至目标">#</a></dt>
<dd><p>清除缓存</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-46-46-1" class="sphinx-tabs-panel" hidden="true" id="panel-46-46-1" name="46-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.clear_cache">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">clear_cache</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.clear_cache" title="永久链接至目标">#</a></dt>
<dd><p>清除缓存</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="javascript">
<h2>注入JavaScript<a class="headerlink" href="#javascript" title="此标题的永久链接">#</a></h2>
<section id="js-executescript">
<h3>注入执行 JS <code class="docutils literal notranslate"><span class="pre">executeScript()</span></code><a class="headerlink" href="#js-executescript" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-47-47-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-47-47-0" name="47-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-47-47-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-47-47-1" name="47-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-47-47-0" class="sphinx-tabs-panel" id="panel-47-47-0" name="47-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.executeScript">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">executeScript</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">command</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.executeScript" title="永久链接至目标">#</a></dt>
<dd><p>注入JavaScript</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>command</strong> (<em>string</em>) – 注入的js代码</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 假如注入代码为函数且有return语句，则返回retrun 的值，否则返回null;  注入示例：(function () {return “aibote rpa”})();</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-47-47-1" class="sphinx-tabs-panel" hidden="true" id="panel-47-47-1" name="47-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.execute_script">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">execute_script</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">script</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.execute_script" title="永久链接至目标">#</a></dt>
<dd><p>注入执行 JS</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>script</strong> – 要执行的 JS 代码</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>假如注入代码有返回值，则返回此值，否则返回 None;</p>
</dd>
</dl>
<p>Examples:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">result</span> <span class="o">=</span> <span class="n">execute_script</span><span class="p">(</span><span class="s1">&#39;(()=&gt;&quot;aibote rpa&quot;)()&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
<span class="go">&quot;aibote rpa&quot;</span>
</pre></div>
</div>
</dd></dl>

</div></div>
</section>
</section>
<section id="id8">
<h2>浏览器窗口<a class="headerlink" href="#id8" title="此标题的永久链接">#</a></h2>
<section id="getwindowpos">
<h3>获取窗口位置和状态 <code class="docutils literal notranslate"><span class="pre">getWindowPos()</span></code><a class="headerlink" href="#getwindowpos" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-48-48-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-48-48-0" name="48-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-48-48-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-48-48-1" name="48-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-48-48-0" class="sphinx-tabs-panel" id="panel-48-48-0" name="48-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.getWindowPos">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getWindowPos</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.getWindowPos" title="永久链接至目标">#</a></dt>
<dd><p>获取窗口位置和状态</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;{left:number, top:number, width:number, height:number, windowState:string}&gt;</strong> – 成功返回矩形位置和窗口状态，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-48-48-1" class="sphinx-tabs-panel" hidden="true" id="panel-48-48-1" name="48-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.get_window_pos">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">get_window_pos</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WebBotMain.get_window_pos" title="永久链接至目标">#</a></dt>
<dd><p>获取窗口位置和状态</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p>返回窗口左上角坐标点，宽度和高度，状态</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="setwindowpos">
<h3>设置窗口位置和状态 <code class="docutils literal notranslate"><span class="pre">setWindowPos()</span></code><a class="headerlink" href="#setwindowpos" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-49-49-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-49-49-0" name="49-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-49-49-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-49-49-1" name="49-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-49-49-0" class="sphinx-tabs-panel" id="panel-49-49-0" name="49-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.setWindowPos">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setWindowPos</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">windowState</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">可选参数，浏览器窗口位置，此参数仅windowState</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.setWindowPos" title="永久链接至目标">#</a></dt>
<dd><p>设置窗口位置和状态</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>windowState</strong> (<em>string</em>) – 窗口状态，正常:”normal”  最小化:”minimized”  最大化:”maximized”  全屏:”fullscreen”</p></li>
<li><p><strong>可选参数，浏览器窗口位置，此参数仅windowState</strong> (<em>Object</em>) – 值为 “normal” 时有效</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-49-49-1" class="sphinx-tabs-panel" hidden="true" id="panel-49-49-1" name="49-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.set_window_pos">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">set_window_pos</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">left</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">top</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">status</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.set_window_pos" title="永久链接至目标">#</a></dt>
<dd><p>设置窗口位置和状态</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – 窗口 x 坐标</p></li>
<li><p><strong>top</strong> – 窗口 y 坐标</p></li>
<li><p><strong>width</strong> – 宽度</p></li>
<li><p><strong>height</strong> – 高度</p></li>
<li><p><strong>status</strong> – 状态</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id9">
<h2>手机浏览器仿真<a class="headerlink" href="#id9" title="此标题的永久链接">#</a></h2>
<section id="mobileemulation">
<h3>手机浏览器仿真 <code class="docutils literal notranslate"><span class="pre">mobileEmulation()</span></code><a class="headerlink" href="#mobileemulation" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-50-50-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-50-50-0" name="50-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-50-50-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-50-50-1" name="50-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-50-50-0" class="sphinx-tabs-panel" id="panel-50-50-0" name="50-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.mobileEmulation">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">mobileEmulation</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">userAgent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">platform</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">platformVersion</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">acceptLanguage</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timezoneId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">latitude=0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">longitude=0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">accuracy=0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.mobileEmulation" title="永久链接至目标">#</a></dt>
<dd><p>手机浏览器仿真</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>width</strong> (<em>number</em>) – 宽度</p></li>
<li><p><strong>height</strong> (<em>number</em>) – 高度</p></li>
<li><p><strong>userAgent</strong> (<em>string</em>) – 用户代理</p></li>
<li><p><strong>platform</strong> (<em>string</em>) – 系统平台，例如 “Android”、”IOS”、”iPhone”</p></li>
<li><p><strong>platformVersion</strong> (<em>string</em>) – 系统版本号，例如 “9.0”，应当与userAgent提供的版本号对应</p></li>
<li><p><strong>acceptLanguage</strong> (<em>string</em>) – 可选参数，语言，例如 “zh-CN”、”en”</p></li>
<li><p><strong>timezoneId</strong> (<em>string</em>) – 可选参数，时区标识，例如”Asia/Shanghai”、”Europe/Berlin”、”Europe/London” 时区应当与 语言、经纬度 对应</p></li>
<li><p><strong>latitude</strong> (<em>number</em>) – 可选参数，纬度，例如 31.230416</p></li>
<li><p><strong>longitude</strong> (<em>number</em>) – 可选参数，经度，例如 121.473701</p></li>
<li><p><strong>accuracy</strong> (<em>number</em>) – 可选参数，精度，例如 1111</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-50-50-1" class="sphinx-tabs-panel" hidden="true" id="panel-50-50-1" name="50-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.mobile_emulation">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">mobile_emulation</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">width</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ua</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">_sys</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Literal</span><span class="p"><span class="pre">[</span></span><span class="s"><span class="pre">'Android'</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="s"><span class="pre">'iOS'</span></span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sys_version</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lang</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tz</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">latitude</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">longitude</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">accuracy</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.mobile_emulation" title="永久链接至目标">#</a></dt>
<dd><p>模拟移动端浏览器</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>width</strong> – 宽度</p></li>
<li><p><strong>height</strong> – 高度</p></li>
<li><p><strong>ua</strong> – 用户代理</p></li>
<li><p><strong>_sys</strong> – 系统</p></li>
<li><p><strong>sys_version</strong> – 系统版本</p></li>
<li><p><strong>lang</strong> – 语言</p></li>
<li><p><strong>tz</strong> – 时区</p></li>
<li><p><strong>latitude</strong> – 纬度</p></li>
<li><p><strong>longitude</strong> – 经度</p></li>
<li><p><strong>accuracy</strong> – 准确度</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id10">
<h2>关闭浏览器<a class="headerlink" href="#id10" title="此标题的永久链接">#</a></h2>
<section id="closebrowser">
<h3>关闭浏览器 <code class="docutils literal notranslate"><span class="pre">closeBrowser()</span></code><a class="headerlink" href="#closebrowser" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-51-51-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-51-51-0" name="51-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-51-51-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-51-51-1" name="51-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-51-51-0" class="sphinx-tabs-panel" id="panel-51-51-0" name="51-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.closeBrowser">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">closeBrowser</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.closeBrowser" title="永久链接至目标">#</a></dt>
<dd><p>关闭浏览器</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-51-51-1" class="sphinx-tabs-panel" hidden="true" id="panel-51-51-1" name="51-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WebBotMain.quit">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">quit</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WebBotMain.quit" title="永久链接至目标">#</a></dt>
<dd><p>退出浏览器</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="webdriver-exe">
<h2>关闭WebDriver.exe驱动程序<a class="headerlink" href="#webdriver-exe" title="此标题的永久链接">#</a></h2>
<section id="webdriver-exe-closedriver">
<h3>关闭WebDriver.exe驱动程序 <code class="docutils literal notranslate"><span class="pre">closeDriver()</span></code><a class="headerlink" href="#webdriver-exe-closedriver" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-52-52-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-52-52-0" name="52-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-52-52-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-52-52-1" name="52-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-52-52-0" class="sphinx-tabs-panel" id="panel-52-52-0" name="52-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WebBot.closeDriver">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WebBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">closeDriver</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WebBot.closeDriver" title="永久链接至目标">#</a></dt>
<dd><p>关闭WebDriver.exe驱动程序</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;void&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-52-52-1" class="sphinx-tabs-panel" hidden="true" id="panel-52-52-1" name="52-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id11">
<span class="sig-prename descclassname"><span class="pre">WebBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id11" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
</section>
</section>


                </article>
              
              
              
                <footer class="bd-footer-article">
                  <!-- Previous / next buttons -->
<div class="prev-next-area">
    <a class="left-prev"
       href="../android_bot/index.html"
       title="previous page">
      <i class="fa-solid fa-angle-left"></i>
      <div class="prev-next-info">
        <p class="prev-next-subtitle">上一页</p>
        <p class="prev-next-title">AndroidBot</p>
      </div>
    </a>
    <a class="right-next"
       href="../window_bot/index.html"
       title="next page">
      <div class="prev-next-info">
        <p class="prev-next-subtitle">下一页</p>
        <p class="prev-next-title">WindowBot</p>
      </div>
      <i class="fa-solid fa-angle-right"></i>
    </a>
</div>
                </footer>
              
            </div>
            
            
              
                <div class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">

  <div class="sidebar-secondary-item">
  <div class="page-toc tocsection onthispage">
    <i class="fa-solid fa-list"></i> On this page
  </div>
  <nav class="bd-toc-nav page-toc">
    <ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id1">主函数示例</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id2">等待超时</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sleep">显示等待 <code class="docutils literal notranslate"><span class="pre">sleep()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.sleep"><code class="docutils literal notranslate"><span class="pre">WebBot.sleep()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.todo"><code class="docutils literal notranslate"><span class="pre">WebBotMain.todo()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id3">隐式等待 <code class="docutils literal notranslate"><span class="pre">sleep()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.setImplicitTimeout"><code class="docutils literal notranslate"><span class="pre">WebBot.setImplicitTimeout()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id0"><code class="docutils literal notranslate"><span class="pre">WebBotMain.todo()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id4">页面和导航</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#url-goto">打开URL <code class="docutils literal notranslate"><span class="pre">goto()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.goto"><code class="docutils literal notranslate"><span class="pre">WebBot.goto()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.goto"><code class="docutils literal notranslate"><span class="pre">WebBotMain.goto()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#newpage">新建页面并跳转 <code class="docutils literal notranslate"><span class="pre">newPage()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.newPage"><code class="docutils literal notranslate"><span class="pre">WebBot.newPage()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.new_page"><code class="docutils literal notranslate"><span class="pre">WebBotMain.new_page()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#back">后退 <code class="docutils literal notranslate"><span class="pre">back()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.back"><code class="docutils literal notranslate"><span class="pre">WebBot.back()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.back"><code class="docutils literal notranslate"><span class="pre">WebBotMain.back()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#forward">前进 <code class="docutils literal notranslate"><span class="pre">forward()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.forward"><code class="docutils literal notranslate"><span class="pre">WebBot.forward()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.forward"><code class="docutils literal notranslate"><span class="pre">WebBotMain.forward()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#refresh">刷新 <code class="docutils literal notranslate"><span class="pre">refresh()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.refresh"><code class="docutils literal notranslate"><span class="pre">WebBot.refresh()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.refresh"><code class="docutils literal notranslate"><span class="pre">WebBotMain.refresh()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id-getcurpageid">获取当前页面ID <code class="docutils literal notranslate"><span class="pre">getCurPageId()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getCurPageId"><code class="docutils literal notranslate"><span class="pre">WebBot.getCurPageId()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_current_page_id"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_current_page_id()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id-getallpageid">获取页面ID数组 <code class="docutils literal notranslate"><span class="pre">getAllPageId()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getAllPageId"><code class="docutils literal notranslate"><span class="pre">WebBot.getAllPageId()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_all_page_id"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_all_page_id()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#switchpage">切换指定页面 <code class="docutils literal notranslate"><span class="pre">switchPage()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.switchPage"><code class="docutils literal notranslate"><span class="pre">WebBot.switchPage()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.switch_to_page"><code class="docutils literal notranslate"><span class="pre">WebBotMain.switch_to_page()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#closepage">关闭当前页面 <code class="docutils literal notranslate"><span class="pre">closePage()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.closePage"><code class="docutils literal notranslate"><span class="pre">WebBot.closePage()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.close_current_page"><code class="docutils literal notranslate"><span class="pre">WebBotMain.close_current_page()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#url-getcurrenturl">获取URL <code class="docutils literal notranslate"><span class="pre">getCurrentUrl()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getCurrentUrl"><code class="docutils literal notranslate"><span class="pre">WebBot.getCurrentUrl()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_current_url"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_current_url()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#gettitle">获取页面标题 <code class="docutils literal notranslate"><span class="pre">getTitle()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getTitle"><code class="docutils literal notranslate"><span class="pre">WebBot.getTitle()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_current_title"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_current_title()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#iframe">IFrame</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#frame-switchframe">切换frame <code class="docutils literal notranslate"><span class="pre">switchFrame()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.switchFrame"><code class="docutils literal notranslate"><span class="pre">WebBot.switchFrame()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.switch_to_frame"><code class="docutils literal notranslate"><span class="pre">WebBotMain.switch_to_frame()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#frame-switchmainframe">切换主frame <code class="docutils literal notranslate"><span class="pre">switchMainFrame()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.switchMainFrame"><code class="docutils literal notranslate"><span class="pre">WebBot.switchMainFrame()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.switch_to_main_frame"><code class="docutils literal notranslate"><span class="pre">WebBotMain.switch_to_main_frame()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id5">元素操作</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#click-element">点击元素 <code class="docutils literal notranslate"><span class="pre">click_element()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.clickElement"><code class="docutils literal notranslate"><span class="pre">WebBot.clickElement()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.click_element"><code class="docutils literal notranslate"><span class="pre">WebBotMain.click_element()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setelementvalue">设置编辑框内容 <code class="docutils literal notranslate"><span class="pre">setElementValue()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.setElementValue"><code class="docutils literal notranslate"><span class="pre">WebBot.setElementValue()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.set_element_value"><code class="docutils literal notranslate"><span class="pre">WebBotMain.set_element_value()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getelementtext">获取元素文本 <code class="docutils literal notranslate"><span class="pre">getElementText()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getElementText"><code class="docutils literal notranslate"><span class="pre">WebBot.getElementText()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_element_text"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_element_text()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#outerhtml-getelementouterhtml">获取outerHTML <code class="docutils literal notranslate"><span class="pre">getElementOuterHTML()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getElementOuterHTML"><code class="docutils literal notranslate"><span class="pre">WebBot.getElementOuterHTML()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_element_outer_html"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_element_outer_html()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#innerhtml-getelementinnerhtml">获取innerHTML <code class="docutils literal notranslate"><span class="pre">getElementInnerHTML()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getElementInnerHTML"><code class="docutils literal notranslate"><span class="pre">WebBot.getElementInnerHTML()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_element_inner_html"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_element_inner_html()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setelementattribute">设置属性值 <code class="docutils literal notranslate"><span class="pre">setElementAttribute()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.setElementAttribute"><code class="docutils literal notranslate"><span class="pre">WebBot.setElementAttribute()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.set_element_attr"><code class="docutils literal notranslate"><span class="pre">WebBotMain.set_element_attr()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getelementattribute">获取属性值 <code class="docutils literal notranslate"><span class="pre">getElementAttribute()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getElementAttribute"><code class="docutils literal notranslate"><span class="pre">WebBot.getElementAttribute()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_element_attr"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_element_attr()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#get-element-rect">获取矩形位置 <code class="docutils literal notranslate"><span class="pre">get_element_rect()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getElementRect"><code class="docutils literal notranslate"><span class="pre">WebBot.getElementRect()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_element_rect"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_element_rect()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#isselected">判断该元素是否选中 <code class="docutils literal notranslate"><span class="pre">isSelected()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.isSelected"><code class="docutils literal notranslate"><span class="pre">WebBot.isSelected()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.is_selected"><code class="docutils literal notranslate"><span class="pre">WebBotMain.is_selected()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#is-displayed">判断该元素是否可见 <code class="docutils literal notranslate"><span class="pre">is_displayed()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.isDisplayed"><code class="docutils literal notranslate"><span class="pre">WebBot.isDisplayed()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.is_displayed"><code class="docutils literal notranslate"><span class="pre">WebBotMain.is_displayed()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#isenabled">判断元素是否可用 <code class="docutils literal notranslate"><span class="pre">isEnabled()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.isEnabled"><code class="docutils literal notranslate"><span class="pre">WebBot.isEnabled()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.is_available"><code class="docutils literal notranslate"><span class="pre">WebBotMain.is_available()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clearelement">清除元素值 <code class="docutils literal notranslate"><span class="pre">clearElement()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.clearElement"><code class="docutils literal notranslate"><span class="pre">WebBot.clearElement()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.clear_element"><code class="docutils literal notranslate"><span class="pre">WebBotMain.clear_element()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setelementfocus">设置元素焦点 <code class="docutils literal notranslate"><span class="pre">setElementFocus()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.setElementFocus"><code class="docutils literal notranslate"><span class="pre">WebBot.setElementFocus()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.set_element_focus"><code class="docutils literal notranslate"><span class="pre">WebBotMain.set_element_focus()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#uploadfile">通过元素上传文件 <code class="docutils literal notranslate"><span class="pre">uploadFile()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.uploadFile"><code class="docutils literal notranslate"><span class="pre">WebBot.uploadFile()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.upload_file_by_element"><code class="docutils literal notranslate"><span class="pre">WebBotMain.upload_file_by_element()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id6">鼠标键盘</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sendkeys">发送文本 <code class="docutils literal notranslate"><span class="pre">sendKeys()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.sendKeys"><code class="docutils literal notranslate"><span class="pre">WebBot.sendKeys()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.send_keys"><code class="docutils literal notranslate"><span class="pre">WebBotMain.send_keys()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#vk-sendvk">发送Vk虚拟键 <code class="docutils literal notranslate"><span class="pre">sendVk()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.sendVk"><code class="docutils literal notranslate"><span class="pre">WebBot.sendVk()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.send_vk"><code class="docutils literal notranslate"><span class="pre">WebBotMain.send_vk()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clickmouse">点击鼠标 <code class="docutils literal notranslate"><span class="pre">clickMouse()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.clickMouse"><code class="docutils literal notranslate"><span class="pre">WebBot.clickMouse()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.click_mouse"><code class="docutils literal notranslate"><span class="pre">WebBotMain.click_mouse()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#movemouse">移动鼠标 <code class="docutils literal notranslate"><span class="pre">moveMouse()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.moveMouse"><code class="docutils literal notranslate"><span class="pre">WebBot.moveMouse()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.move_mouse"><code class="docutils literal notranslate"><span class="pre">WebBotMain.move_mouse()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#wheelmouse">滚动鼠标 wheelMouse()</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.wheelMouse"><code class="docutils literal notranslate"><span class="pre">WebBot.wheelMouse()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.scroll_mouse"><code class="docutils literal notranslate"><span class="pre">WebBotMain.scroll_mouse()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#xpath-clickmousebyxpath">通过 xpath 点击鼠标(元素中心点) <code class="docutils literal notranslate"><span class="pre">clickMouseByXpath()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.clickMouseByXpath"><code class="docutils literal notranslate"><span class="pre">WebBot.clickMouseByXpath()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.click_mouse_by_element"><code class="docutils literal notranslate"><span class="pre">WebBotMain.click_mouse_by_element()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#xpath-movemousebyxpath">通过 xpath 移动鼠标(元素中心点) <code class="docutils literal notranslate"><span class="pre">moveMouseByXpath()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.moveMouseByXpath"><code class="docutils literal notranslate"><span class="pre">WebBot.moveMouseByXpath()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.move_to_element"><code class="docutils literal notranslate"><span class="pre">WebBotMain.move_to_element()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#xpath-wheelmousebyxpath">通过 xpath 滚动鼠标 <code class="docutils literal notranslate"><span class="pre">wheelMouseByXpath()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.wheelMouseByXpath"><code class="docutils literal notranslate"><span class="pre">WebBot.wheelMouseByXpath()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.scroll_mouse_by_element"><code class="docutils literal notranslate"><span class="pre">WebBotMain.scroll_mouse_by_element()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id7">截图</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#png-base64-takescreenshot">截图(PNG-base64) <code class="docutils literal notranslate"><span class="pre">takeScreenshot()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.takeScreenshot"><code class="docutils literal notranslate"><span class="pre">WebBot.takeScreenshot()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.save_screenshot"><code class="docutils literal notranslate"><span class="pre">WebBotMain.save_screenshot()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#alert-prompt">alert/prompt弹窗</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clickalert">点击警告框 <code class="docutils literal notranslate"><span class="pre">clickAlert()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.clickAlert"><code class="docutils literal notranslate"><span class="pre">WebBot.clickAlert()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.click_alert"><code class="docutils literal notranslate"><span class="pre">WebBotMain.click_alert()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getalerttext">获取警告框文本 <code class="docutils literal notranslate"><span class="pre">getAlertText()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getAlertText"><code class="docutils literal notranslate"><span class="pre">WebBot.getAlertText()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_alert_text"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_alert_text()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#cookie">cookie操作</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#urlcookies-getcookies-url">获取指定url匹配的cookies <code class="docutils literal notranslate"><span class="pre">getCookies(url)</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getCookies"><code class="docutils literal notranslate"><span class="pre">WebBot.getCookies()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_cookies"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_cookies()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#cookies-getallcookies">获取所有的Cookies <code class="docutils literal notranslate"><span class="pre">getAllCookies()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getAllCookies"><code class="docutils literal notranslate"><span class="pre">WebBot.getAllCookies()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_all_cookies"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_all_cookies()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#cookies-setcookie">设置cookies <code class="docutils literal notranslate"><span class="pre">setCookie()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.setCookie"><code class="docutils literal notranslate"><span class="pre">WebBot.setCookie()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.set_cookies"><code class="docutils literal notranslate"><span class="pre">WebBotMain.set_cookies()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#cookies-deletecookies">删除cookies <code class="docutils literal notranslate"><span class="pre">deleteCookies()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.deleteCookies"><code class="docutils literal notranslate"><span class="pre">WebBot.deleteCookies()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.delete_cookies"><code class="docutils literal notranslate"><span class="pre">WebBotMain.delete_cookies()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#cookies-deleteallcookies">删除所有cookies <code class="docutils literal notranslate"><span class="pre">deleteAllCookies()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.deleteAllCookies"><code class="docutils literal notranslate"><span class="pre">WebBot.deleteAllCookies()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.delete_all_cookies"><code class="docutils literal notranslate"><span class="pre">WebBotMain.delete_all_cookies()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clearcache">清除缓存 <code class="docutils literal notranslate"><span class="pre">clearCache()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.clearCache"><code class="docutils literal notranslate"><span class="pre">WebBot.clearCache()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.clear_cache"><code class="docutils literal notranslate"><span class="pre">WebBotMain.clear_cache()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#javascript">注入JavaScript</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#js-executescript">注入执行 JS <code class="docutils literal notranslate"><span class="pre">executeScript()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.executeScript"><code class="docutils literal notranslate"><span class="pre">WebBot.executeScript()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.execute_script"><code class="docutils literal notranslate"><span class="pre">WebBotMain.execute_script()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id8">浏览器窗口</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getwindowpos">获取窗口位置和状态 <code class="docutils literal notranslate"><span class="pre">getWindowPos()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.getWindowPos"><code class="docutils literal notranslate"><span class="pre">WebBot.getWindowPos()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.get_window_pos"><code class="docutils literal notranslate"><span class="pre">WebBotMain.get_window_pos()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setwindowpos">设置窗口位置和状态 <code class="docutils literal notranslate"><span class="pre">setWindowPos()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.setWindowPos"><code class="docutils literal notranslate"><span class="pre">WebBot.setWindowPos()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.set_window_pos"><code class="docutils literal notranslate"><span class="pre">WebBotMain.set_window_pos()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id9">手机浏览器仿真</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#mobileemulation">手机浏览器仿真 <code class="docutils literal notranslate"><span class="pre">mobileEmulation()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.mobileEmulation"><code class="docutils literal notranslate"><span class="pre">WebBot.mobileEmulation()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.mobile_emulation"><code class="docutils literal notranslate"><span class="pre">WebBotMain.mobile_emulation()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id10">关闭浏览器</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#closebrowser">关闭浏览器 <code class="docutils literal notranslate"><span class="pre">closeBrowser()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.closeBrowser"><code class="docutils literal notranslate"><span class="pre">WebBot.closeBrowser()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WebBotMain.quit"><code class="docutils literal notranslate"><span class="pre">WebBotMain.quit()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#webdriver-exe">关闭WebDriver.exe驱动程序</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#webdriver-exe-closedriver">关闭WebDriver.exe驱动程序 <code class="docutils literal notranslate"><span class="pre">closeDriver()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WebBot.closeDriver"><code class="docutils literal notranslate"><span class="pre">WebBot.closeDriver()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id11"><code class="docutils literal notranslate"><span class="pre">WebBotMain.todo()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
  </nav></div>

</div></div>
              
            
          </div>
          <footer class="bd-footer-content">
            <div class="bd-footer-content__inner"></div>
          </footer>
        
      </main>
    </div>
  </div>
  
  <!-- Scripts loaded after <body> so the DOM is not blocked -->
  <script src="../../_static/scripts/bootstrap.js?digest=12da95d707ffb74b382d"></script>
<script src="../../_static/scripts/pydata-sphinx-theme.js?digest=12da95d707ffb74b382d"></script>

  <footer class="bd-footer">
<div class="bd-footer__inner bd-page-width">
  
    <div class="footer-items__start">
      
        <div class="footer-item">
  <p class="copyright">
    
      © Copyright 2023, Aibote.
      <br/>
    
  </p>
</div>
      
        <div class="footer-item">
  <p class="sphinx-version">
    Created using <a href="https://sphinx-doc.org/">Sphinx</a> 5.3.0.
    <br/>
  </p>
</div>
      
    </div>
  
  
    <div class="footer-items__end">
      
        <div class="footer-item"><p class="theme-version">
  Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.13.1.
</p></div>
      
    </div>
  
</div>

  </footer>
  </body>
</html>